package com.ferenc.redisson.controller;

import com.ferenc.redisson.service.ProductInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @author <a href="mailto:ferenc.zeng@gmail.com">Ferenc Zeng</a>
 * @since 2022-02-02
 */
@RestController
public class TestController {
    @Autowired
    ProductInfoService productInfoService;

    @GetMapping("test")
    public String test() {
        if (!productInfoService.decrementProductStore(1L, 1)) {
            return "库存不足";
        }
        return "success";

    }
}
